package com.yangrd.helper.crudhelper.core.crud.page.impl;

import com.yangrd.helper.crudhelper.core.crud.page.AmisCurdTemplate;
import com.yangrd.helper.crudhelper.core.crud.page.CrudPage;
import com.yangrd.helper.crudhelper.core.crud.page.CrudPageFactory;
import com.yangrd.helper.crudhelper.core.crud.page.DomainMappingManager;
import lombok.RequiredArgsConstructor;

/**
 * description: AmisCrudPageFactory
 *
 * @author: yangrd
 * @date: 2020/10/23
 * @version: 1.0
 */
@RequiredArgsConstructor
public class AmisCrudPageFactory implements CrudPageFactory {

    private final AmisCurdTemplate curdTemplate;

    @Override
    public CrudPage create(Class<?> domainClass) {
        return StringCrudPage.of(DomainMappingManager.MappingSupport.getDomainName(domainClass), curdTemplate.genCrudTemplate(domainClass));
    }
}
